package factory.controller;

import codeManageInfo.dto.QueryDTO;
import dataAsset.domain.DataAssetInfo;
import dataAsset.dto.DataAssetDTO;
import factory.service.DataAssetService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.PageDTO;
import result.R;

@Slf4j
@RestController
@Tag(name = "数据资产管理",description = "数据资产管理")
@RequestMapping("/dataAsset")
public class DataAssetController {
    @Resource
    private DataAssetService dataAssetService;
    @Operation(summary = "分页查询所有码表",description = "分页查询所有码表")
    @PostMapping("/pageAll")
    public R pageAll(@RequestBody PageDTO pageDTO){
        return  R.OK(dataAssetService.pageAll(pageDTO));
    }

    @Operation(summary = "条件分页查询所有码表",description = "条件分页查询所有码表")
    @PostMapping("/pageAllByQuery")
    public R pageAllByQuery(@RequestBody DataAssetDTO dataAssetDTO){
        return  R.OK(dataAssetService.pageAllByQuery(dataAssetDTO));
    }

    @Operation(summary = "根据中文名或者英文名显示详情",description = "根据中文名或者英文名显示详情")
    @PostMapping("/onclickName")
    public R onclickName(Integer id){
        return  R.OK(dataAssetService.onclickName(id));
    }
}
